/**
  * Author: Mei
  * Date: 2020-12-13 15:11
  * Description:  特化数据类型表
  *
  */
#include "../head.h"
using namespace std;

class Test1;

class Test2;

//统一模板接口
template<typename T>
class TypeTb {

};

//特例模板1
template<>
class TypeTb<Test1> {
public:
    typedef char ret_type;
    typedef int par1_type;
    typedef double par2_type;
};

//特例模板2
template<>
class TypeTb<Test2> {
public:
    typedef double ret_type;
    typedef double par1_type;
    typedef int par2_type;
};

//Test1和Test2两个类的类模板
template<typename T>
class Test {
public:
    typename TypeTb<T>::ret_type computer(
            typename TypeTb<T>::par1_type x,
            typename TypeTb<T>::par2_type y
    ) {
        return x;
    }
};

int main() {
    Test<Test2> t1;
    cout << t1.computer(12, 33.2) << endl;

    return 0;
}